<template>
  <el-icon :size="$props.size"> <component :is="Icon" /> </el-icon>
</template>

<script setup lang="ts">
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
const props = withDefaults(
  defineProps<{
    icon: string;
    size?: string;
  }>(),
  {
    size: "18px",
  }
);

const Icon = computed(
  () => ElementPlusIconsVue[props.icon as keyof typeof ElementPlusIconsVue]
);
</script>

<style scoped lang="scss"></style>
